package com.qf.controller;

import com.qf.service.AdminCarService;
import com.qf.service.CarService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/Admincar")
public class  AdminCarController {
    @Autowired
    AdminCarService adminCarService;

    @Autowired
    CarService carService;

    @GetMapping("/findAllCar")
    public ResultMsg findAll(int page,int limit){
        return adminCarService.findAllCar(page,limit);

    }
    @GetMapping("/findOne/{cid}")
    public ResultMsg findOneCar(@PathVariable("cid") Integer cid){
        return adminCarService.findOne(cid);

    }
    @GetMapping("/findStartAddr")
    public ResultMsg startAddr(){
        return carService.findAllStarName();
    }
    @GetMapping("/findEndAddr")
    public ResultMsg endAddr(){
        return carService.findAllEndName();

    }



}
